﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;

public partial class common_menu_index : System.Web.UI.UserControl
{
    protected string str = "";
    protected void Page_Load(object sender, EventArgs e)
    {

        switch (Request.ServerVariables["SCRIPT_NAME"].ToLower())
        {

            case "/cn/hyuan.aspx":
                str = "menubox_ul_a";
                break;
            case "/cn/down.aspx":
                str = "menubox_ul_a";
                break;
            case "/cn/information.aspx":
                str = "menubox_ul_a";
                break;
            case "/cn/forgetpwd.aspx":
                str = "menubox_ul_a";
                break;
            default: str = ""; break;

        }



        if (Session["UserName"] != null)
        {
            li1.Visible = true;
            li2.Visible = true;
            li3.Visible = true;
            li4.Visible = true;
            ltrColumnName.Text = "会员业务系统";
        }
        else
        {
            li1.Visible = false;
            li2.Visible = false;
            li3.Visible = false;
            li4.Visible = false;
            ltrColumnName.Text = "在线咨询";
        }
    }
    protected string GetZtactiveList(int TypeID, int TopNum, int length)
    {
        string sql = "select top " + TopNum + " * from Whir_U_News where TypeID=" + TypeID + " order by CreateDate desc";
        string mode = "ztactive";

        System.Text.StringBuilder sb = new StringBuilder();
        System.Data.DataTable dt = Whir.SQLServerDAL.DbHelperSQL.Query(sql).Tables[0];
        if (dt != null && dt.Rows.Count > 0)
        {
            foreach (System.Data.DataRow dr in dt.Rows)
            {
                string title = dr["Title"].ToString();
                string id = dr["Whir_U_News_PID"].ToString();
                string _TypeID = dr["TypeID"].ToString();
                sb.AppendFormat("<li><a title=\"{0}\"   href=\"news_info.aspx?id={1}&mode=pxnews&cid={2}\">" + Whir.Common.WebHelper.StringHelper.CutString(dr["Title"].ToString(), length) + "</a></li>", title, id, _TypeID);
            }
        }

        return sb.ToString();
    }
}
